package practice1_100;

import java.util.ArrayList;
import java.util.List;

public class sumBaseProb {
    public int sumBase(int n, int k) {
        int res=0;
        while(true){
            if(n==0) break;
            res+=n%k;
            n=n/k;
        }
        return res;
    }

    public static void main(String[] args) {
        int a=new sumBaseProb().sumBase(24324,8);
        System.out.println(a);
    }

}
